#!/usr/bin/env python 

'''
Created on 30/set/2009

@author: syn
'''
import pygtk
pygtk.require20()
import gtk

from ui.Login import Login
from ui.Main import Main
from utils import envir

if __name__ == '__main__':
    while True:
        envir.set_user()
        lg = Login()
        res = lg.run()
        lg.destroy()
    
        if res == gtk.RESPONSE_OK:
            # user exist. running main window
            envir.set_user(lg.user.id, lg.user.type, lg.user.subject)
            del lg
            m = Main()
            gtk.main()
        else:
            break